package com.lw.cms.api;

import com.lw.cms.entity.CrmBanner;
import com.lw.cms.service.CrmService;
import com.lw.commonutil.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/crm/banner")
public class CrmApiController {
    @Autowired
    private CrmService crmService;
    //查询最新两条banner
    @GetMapping("/findAll")
    public Result findAll(){
        List<CrmBanner> list = crmService.findTwoBanners();
        return Result.ok(list);
    }
}
